package com.hyj.shop.project.goods.controller;

import com.hyj.shop.project.utils.domain.AjaxResult;
import com.hyj.shop.project.utils.domain.Msg;
import com.hyj.shop.project.goods.service.GoodsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping( "/api")
public class GoodsInfoController {
    @Autowired
    private GoodsInfoService goodsInfoService;
    @RequestMapping(value = "/goodsInfo/query")
    @ResponseBody
    public Msg queryGoodsInfo(@RequestBody int goodsId) {
        return goodsInfoService.queryGoodsInfo(goodsId);
    }
    @RequestMapping(value = "/goodsSpe/query")
    @ResponseBody
    //查询商品规格信息
    public AjaxResult queryGoodsSpeInfo(@RequestParam String goodsSpe,int goodsId) {
        System.out.println(goodsSpe);
        return goodsInfoService.queryGoodsSpeInfo(goodsSpe,goodsId);
    }
    @RequestMapping(value = "/goodsInfo/imgs")
    @ResponseBody
    //查询商品的详细图片
    public AjaxResult queryGoodsInfoImgs(@RequestParam int goodsId) {
        System.out.println(goodsId);
        return goodsInfoService.queryGoodsInfoImgs(goodsId);
    }
}
